<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>淡旺季购买机票的价格</title>
	</head>

	<body>
		
		<script>
			//获取当前月份
			var time = new Date().getMonth() + 1;
			var p = prompt('请输入您要选择的舱位');
			if(time >= 5 && time <= 10) {
				if(p == '头等舱') {
					console.log(2000);
				} else if(p == '经济舱') {
					console.log(800);
				}else if(p=='头等舱'||'经济舱'){
					alert('请输入正确内容');
				}
			}
			if(time >= 1 && time <= 4 || time >= 11) {
				if(p == '头等舱') {
					console.log(800);
				} else if(p == '经济舱') {
					console.log(200);
				}else if(p=='头等舱'||'经济舱'){
					alert('请输入正确内容');
				}
			}
		</script>
	</body>

</html>